package com.qiqidream.admin.monitor.api;

import com.qiqidream.admin.common.base.BaseController;
import com.qiqidream.admin.common.entity.PageEntity;
import com.qiqidream.admin.monitor.model.entity.LogInfo;
import com.qiqidream.admin.monitor.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author QiQiDream
 * @since 2019/12/21 9:31
 */

@RestController
@Api(tags = "监控：操作日志管理接口")
@RequestMapping("/monitor/log")
public class LogController extends BaseController {

    @Resource
    LogService logService;

    @ApiOperation(value = "查询日志列表")
    @GetMapping("")
    public PageEntity<LogInfo> getLogs(@RequestParam(value = "page", defaultValue = "1") Integer page,
                                       @RequestParam(value = "count", defaultValue = "10") Integer count) {
        return logService.page(page,count);
    }
}
